%%%column1(consumerid)
%%%column2(dimension)
%%%column3(brandid)
%%%column4(pagesviewed)
%%%column5(duration)
%%%column6(jean)
%%%column7(prod_totprice)
%%%column8(hoh_most_educaiton)
%%%column9(household_size)
%%%column10(hoh_oldest_age)
%%%column11(household_income)
%%%column12(children)
tic %init=fminunc(@LL,rand(1,64));
init=[[-1.34229217969337,1.72243426103950,3.74908781757517,5.51500832082621,3.92398176914621,0.904492678130076,4.47570595742483,-0.0348034796997744,1.74721653137794,0.960531069785486,3.61143155654981,-0.382845288276771,0.141085654305971,-0.867454660533291,-0.829903096245174,4.67338655703116,-0.246677530110037,-0.598696260168965,1.00346036655039,-0.527255179128913,-0.321048134833989,-0.724668779492386,-0.553609001305331,-0.949937945445712,-3.52496706810189,-1.47390256807822,0.323499934257574,-0.736644538772695,-0.941301729225832,-0.719599462477416,6.48869985113916,2.21199189722897,2.30345443724796,4.32801542605898,3.45878524393042;]];
options = optimset('Display','iter','MaxIter',10000,'MaxFunEvals',10000,'TolFun',1e-12,'TolX',1e-12,'GradObj','off');
%init=[-21.31 6.23 0.51 1.51 0.79 0.83 0.82 0.27 0.64 0.69 0.71 0.8 0.77 0.24 0.58 0.15 0.05 0.11 0.59 0.49 0.59 0.95 0.67 0.007 0.34 0.76 0.79 0.12 0.48 0.67 1.05 9.57 -0.32 0.40 0.24 0.55 0.657 0.72 0.80 0.61 0.01 0.11 0.85 0.43 0.451 0.27 0.3 0.61 0.94 0.27 0.93 0.90 0.69 0.65 0.78 0.47 0.52 0.54 0.29 0.58 0.31 0.07 0.08 0.42];
[theta,fval,exitflag,output,grad,hessian] = fminunc(@minpis,init,options);
SE=sqrt(diag(inv(hessian)));
toc